CSE 311: Section 4

Task 1 – Cartesian Products

Let AA, BB, CC, and DD be sets. Consider the following claim: (AB)×CA×(CD)(A\cap B) \times C \subseteq A \times (C\cup D)

  1. Suppose that A={1,2}A = \{1,2\}, B={1,2,3},C={3,4},D={2}B = \{1,2,3\}, C = \{3,4\}, D = \{2\}.

    Calculate the values of the sets (AB)×C(A \cap B) \times C and A×(CD)A \times (C \cup D). Check whether the claim holds.

  2. Suppose that A={1,2}A = \{1,2\}, B={2,3,4},C={1,2,3},D={1,3}B = \{2,3,4\}, C = \{1,2,3\}, D = \{1,3\}.

    Calculate the values of the sets (AB)×C(A \cap B) \times C and A×(CD)A \times (C \cup D). Check whether the claim holds.

  3. Write an English proof that the claim holds.

    Follow the structure of our template for subset proofs.

    Note: even though we want you to write your proof directly in English, it must still look like the translation of a formal proof. In particular, you must include all steps that would be required of a formal proof, excepting only those that we have explicitly said are okay to skip in English proofs.

Task 2 – Power Sets

Let AA and BB be sets. Consider the following claim: 𝒫(A)𝒫(B)\mathop{\mathrm{\mathcal{P}}}(A) \subseteq \mathop{\mathrm{\mathcal{P}}}(B)

  1. Suppose that A={1}A = \{1\}, B={1,2}B = \{1, 2\}.

    Calculate the values of the sets 𝒫(A)\mathop{\mathrm{\mathcal{P}}}(A) and 𝒫(B)\mathop{\mathrm{\mathcal{P}}}(B). Check whether the claim holds.

  2. Suppose that A={1}A = \{1\}, B={2,3}B = \{2, 3\}.

    Calculate the values of the sets 𝒫(A)\mathop{\mathrm{\mathcal{P}}}(A) and 𝒫(B)\mathop{\mathrm{\mathcal{P}}}(B). Check whether the claim holds.

  3. Write an English proof that the claim holds given that ABA \subseteq B.

    (This updated claim describes the situation in part (a) but not part (b).)

    Follow the structure of our template for subset proofs.

    Note: even though we want you to write your proof directly in English, it must still look like the translation of a formal proof. In particular, you must include all steps that would be required of a formal proof, excepting only those that we have explicitly said are okay to skip in English proofs.

Task 3 – Set Equality

Let AA, BB, and CC be sets. For each of the following claims:

  1. State whether the the claim is true or false.

  2. If the claim is true, write an English proof that the claim holds following the Meta Theorem template. (In your equivalence chain, you can skip steps showing commutativity or associativity, as long as each step is easy to follow.)

  3. If it the claim false, give a counterexample. Provide specific finite sets for AA, BB, and CC, and then calculate the value of each side of the claim, showing that they do not produce the same set. (Be sure to show the value of each intermediate expression, when calculating each side.)

  1. (A\B)\C=A\(BC)(A\,\setminus\,B)\,\setminus\,C = A\,\setminus\,(B \cap C)

  2. A\(BC)=(A\B)(A\C)A\,\setminus\,(B \cup C) = (A\,\setminus\,B) \cap (A\,\setminus\,C)

Task 4 – Structural Induction on Lists

Recall the definition of lists of numbers from lecture:

Basis Step: 𝗇𝗂𝗅𝐋𝐢𝐬𝐭\mathop{\mathrm{\textsf{nil}}}\in \textbf{List}

Recursive Step: for any aa \in \mathbb{Z}, if L𝐋𝐢𝐬𝐭L \in \textbf{List}, then a::L𝐋𝐢𝐬𝐭a :: L \in \textbf{List}.

For example, the list [1,2,3][1, 2, 3] would be created recursively from the empty list as 1::(2::(3::𝗇𝗂𝗅))1 :: (2 :: (3 :: \mathop{\mathrm{\textsf{nil}}})). We will consider “::::” to associate to the right, so 1::2::3::𝗇𝗂𝗅1 :: 2 :: 3 :: \mathop{\mathrm{\textsf{nil}}} means the same thing.

The parts below use two recursively-defined functions. The first is 𝗅𝖾𝗇\mathop{\mathrm{\textsf{len}}}, which calculates the length of the list. It is defined recursively as follows: 𝗅𝖾𝗇(𝗇𝗂𝗅):=0𝗅𝖾𝗇(a::L):=1+𝗅𝖾𝗇(L)a,L𝐋𝐢𝐬𝐭\begin{array}{rcll} \mathop{\mathrm{\textsf{len}}}(\mathop{\mathrm{\textsf{nil}}}) &:=& 0 & \\ \mathop{\mathrm{\textsf{len}}}(a :: L) &:=& 1 + \mathop{\mathrm{\textsf{len}}}(L) & \forall a \in \mathbb{Z}, \forall L \in \textbf{List} \end{array}

The second function, 𝖾𝖼𝗁𝗈-𝗉𝗈𝗌\mathop{\mathrm{\textsf{echo-pos}}}, which duplicates each positive number in the list, is defined by: 𝖾𝖼𝗁𝗈-𝗉𝗈𝗌(𝗇𝗂𝗅):=𝗇𝗂𝗅𝖾𝖼𝗁𝗈-𝗉𝗈𝗌(a::L):=a::𝖾𝖼𝗁𝗈-𝗉𝗈𝗌(L) if a0a,L𝐋𝐢𝐬𝐭𝖾𝖼𝗁𝗈-𝗉𝗈𝗌(a::L):=a::a::𝖾𝖼𝗁𝗈-𝗉𝗈𝗌(L) if a>0a,L𝐋𝐢𝐬𝐭\begin{array}{rclll} \mathop{\mathrm{\textsf{echo-pos}}}(\mathop{\mathrm{\textsf{nil}}}) &:=& \mathop{\mathrm{\textsf{nil}}}& \\ \mathop{\mathrm{\textsf{echo-pos}}}(a :: L) &:=& a :: \mathop{\mathrm{\textsf{echo-pos}}}(L) & \text{ if $a \le 0$} & \forall a \in \mathbb{Z}, \forall L \in \textbf{List} \\ \mathop{\mathrm{\textsf{echo-pos}}}(a :: L) &:=& a :: a :: \mathop{\mathrm{\textsf{echo-pos}}}(L) & \text{ if $a > 0$} & \forall a \in \mathbb{Z}, \forall L \in \textbf{List} \end{array} For example, with these definitions, we get 𝖾𝖼𝗁𝗈-𝗉𝗈𝗌(1::2::3::𝗇𝗂𝗅)=1::2::2::3::𝗇𝗂𝗅\mathop{\mathrm{\textsf{echo-pos}}}(-1 :: 2 :: -3 :: \mathop{\mathrm{\textsf{nil}}}) = -1 :: 2 :: 2 :: -3 :: \mathop{\mathrm{\textsf{nil}}}.

  1. Write a calculation block, citing the appropriate definitions, showing that 𝖾𝖼𝗁𝗈-𝗉𝗈𝗌(1::2::3::𝗇𝗂𝗅)=1::1::2::3::3::𝗇𝗂𝗅\mathop{\mathrm{\textsf{echo-pos}}}(1 :: -2 :: 3 :: \mathop{\mathrm{\textsf{nil}}}) = 1 :: 1 :: -2 :: 3 :: 3 :: \mathop{\mathrm{\textsf{nil}}}

  2. Use structural induction to prove that L𝐋𝐢𝐬𝐭(𝗅𝖾𝗇(𝖾𝖼𝗁𝗈-𝗉𝗈𝗌(L))2𝗅𝖾𝗇(L))\forall L \in \textbf{List}\,(\mathop{\mathrm{\textsf{len}}}(\mathop{\mathrm{\textsf{echo-pos}}}(L)) \le 2 \mathop{\mathrm{\textsf{len}}}(L)) Hint: Use cases in the inductive step.